#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
int main()
{
	umask(0);
	int fd = open("log.txt",O_WRONLY | O_CREAT | O_TRUNC,0666);
	if(fd < 0)
	{
		perror("open");
		return 1;
	}
	printf("open success,fd:%d\n",fd);
	const char* buffer = "AAAAAAAAA	\n";
	write(fd,buffer,strlen(buffer));
	close(fd);
	return 0;
}
